<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="../../vue.js"></script>
    <title>Document</title>
    <style>
      .login {
        border: 1px dotted black;
        width: 300px;
      }
      .res {
        border: 1px dotted black;
        width: 300px;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <div class="login" v-if="isLogin">
        用户名<input type="text" name="" id="" />
        <br />
        密码<input type="text" style="margin-left: 15px" />
      </div>
      <div class="res" v-else>
        用户名<input type="text" />
        <br />
        邮箱<input type="text" />
        <br />
        确认密码<input type="password" />
      </div>
      <button @click="isLogin=true">登录</button>
      <button @click="isLogin=false">注册</button>
    </div>
    <script>
      const vm = new Vue({
        el: '#app',
        data() {
          return {
            isLogin: true,
          };
        },
      });
    </script>
  </body>
</html>
